home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / QuickDraw / Bitblitz 1.0 / LibHeaders / WCenter.h < prev   
Encoding:
C/C++ Source or Header  |  1990-05-09  |  3.5 KB  |  135 lines  |  [TEXT/KAHL]

  1. #ifndef __WCENTER__
  2. #define __WCENTER__
  3.  
  4. /*---------------------------------------------------------------------------------------
  5. //    File:        WCenter.h    
  6. //    Date:        February 13, 1989
  7. //
  8. //    by Mike Puckett, Macintosh CPU Software Quality, x4-1332.
  9. //    © 1989 - 1990, Apple Computer, Inc.
  10. //---------------------------------------------------------------------------------------
  11. */
  12.  
  13. /* Useful constants ---------------------------------------------------------------------
  14. */
  15.  
  16. #ifdef THINK_C
  17. #undef    topLeft
  18. #undef    botRight
  19.     
  20. #define zoomDocProc     8
  21. #define zoomNoGrow    12
  22. #endif
  23.  
  24. #define doMFAdjust    true            /* For use with GetCurScreenRect()    */
  25. #define ignoreMF    false
  26.  
  27. enum
  28. {    bothHV = 1,
  29.     hOnly,
  30.     vOnly,
  31.     vThird
  32.     };
  33. typedef short CenteringType;
  34.  
  35. enum                                /* tic-tac-toe:            */
  36. {    topLeft = 1,                    /* ------------            */
  37.     botLeft,                        /*        tL    mT    tR        */
  38.     topRight,                        /*        mL    XX    mR        */                                
  39.     botRight,                        /*        bL    mB    bR        */
  40.     midTop,
  41.     midLeft,
  42.     midBot,
  43.     midRight
  44.     };
  45. typedef short CorneringType;
  46.  
  47. enum
  48. {    resizeInPlace,                    /* resize from t,l        */    
  49.     resizeFromZero,                    /* resize from 0,0        */
  50.     resizeV2Scrn,                    /* resize to Screen V,h    */
  51.     resizeH2Scrn,                    /* resize to Screen H,v    */            
  52.     resizeBothHV2Scrn                /* resize to Screen H,V    */
  53.     };
  54. typedef short ResizingType;
  55.  
  56.  
  57. #ifndef THINK_C
  58.     typedef pascal GDHandle (* CenteringProcPtr)(ResType resType, short resID, short constraint);
  59. #else
  60.     typedef ProcPtr CenteringProcPtr;
  61. #endif
  62.  
  63. #ifdef __safe_link
  64. extern "C" {
  65. #endif
  66.  
  67. extern pascal void        InitWCenter(                        void);
  68.  
  69. /* The routines -------------------------------------------------------------------------
  70. //
  71. // GetRectGDevice() is a utility routine used by GetCurScreenRect(),
  72. // and should not be used unless GDevices exists.  The routines
  73. // that use GetCurScreenRect(), like SetZoom2CurScreen(), return
  74. // nil on machines where GDevices don’t exists.
  75. */
  76. extern pascal short        HRectLength(        Rect            *theRect);
  77.  
  78. extern pascal short        VRectLength(        Rect            *theRect);
  79.  
  80. extern pascal void        CenterOfRect(        Rect            *theRect,
  81.                                             Point            *thePoint);
  82.  
  83. extern pascal GDHandle    GetRectGDevice(        Rect            *srcRect);
  84.  
  85. extern pascal GDHandle    GetCurScreenRect(    Rect            *srcRect,
  86.                                             Rect            *screenRect,
  87.                                             Boolean            mfAdjust);
  88.                                             
  89. extern pascal void        GetCurSrcRect(        Rect            *srcRect);
  90.                                             
  91. extern          short        DeltaTop(            ResType            resID,
  92.                                             short            wVariant);
  93. extern          short        DeltaLeft(            ResType            resID,
  94.                                             short            wVariant);
  95.  
  96. extern pascal GDHandle    SetZoom2CurScreen(    WindowPtr        theWindow);
  97.  
  98.  
  99. extern pascal void        CenterWRectToXRect(    ResType            resType,
  100.                                             short            resID,
  101.                                             Rect            *theXRect,
  102.                                             CenteringType    constraint);
  103.  
  104. extern pascal void        CornerWRectToXRect(    ResType            resType,
  105.                                             short            resID,
  106.                                             Rect            *theXRect,
  107.                                             CorneringType    constraint);
  108.  
  109. extern pascal GDHandle    CenterWRsrc(        ResType            resType,
  110.                                             short            resID,
  111.                                             CenteringType    constraint);
  112.                                             
  113. extern pascal GDHandle    CornerWRsrc(        ResType            resType,
  114.                                             short            resID,
  115.                                             CorneringType    constraint);
  116.  
  117. extern pascal void        ResizeWRsrc(        ResType            resType,
  118.                                             short            resID,
  119.                                             Point            size,
  120.                                             ResizingType    constraint);
  121.                                         
  122. extern pascal GDHandle    OffsetWRsrc(        ResType            resType,
  123.                                             short            resID,    
  124.                                             short            wCount);
  125.                                             
  126. extern pascal void        GetDLOGTemplate(    short            resID,
  127.                                             DialogTPtr        dlogTPtr);
  128. extern pascal void        SetDLOGTemplate(    short            resID,
  129.                                             DialogTPtr        dlogTPtr);
  130.  
  131. #ifdef __safe_link
  132. }
  133. #endif
  134.  
  135. #endif